#ifndef RECORD
#define RECORD

#include <vector>
#include <iostream>

using namespace std;

template <typename _T>

class Record {
	
	/* Un record contiene tutti i valori delle feature e la classe rappresentata */
	int _class;
	vector<_T> _featureVector;

public:

	Record () : _class(0), _featureVector(0) {}

	Record (vector<_T> featureVector, int classe) : _featureVector(featureVector), _class(classe) {}

	void setClass (int classe) {
		_class = classe;
	}

	int getClass() {
		return _class;
	}

	_T Record::getFeature (unsigned i) {
		return _featureVector[i];
	}

	vector<_T> getFeatureVector () const {
		return _featureVector;
	}

	void setFeatureVector (vector<_T> &featureVector) {
		vector<_T>::iterator it;
		_featureVector.clear();
		_featureVector.assign(featureVector.begin(),featureVector.end());
	}

	/* Extras */

	void printRecord() {
		cout << _class << ": ";
		for (unsigned i=0; i<_featureVector.size(); ++i) {
			cout << _featureVector[i] << ' ';
		}
		cout << endl;
	}

	const _T& operator() (unsigned i) const {
		return _featureVector[i];
	}

};

#endif